<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="showimage">
        <img :src="imaArr[indexs]" alt="">
        <button @click="prev" v-show="indexs!=0">prev</button>
        <button @click="next" v-show="indexs < imaArr.length-1">next</button>

    </div>
    <script src="./vue.js"></script>
    <script>
        var newapp = new Vue({
            el: "#showimage",
            data: {
                imaArr: [
                    "./images/1.png",
                    "./images/2.png",
                    "./images/3.png"
                ],
                indexs: 0,
            },
            methods: {
                prev: function() {
                    //console.log("prev" + this.indexs);
                    this.indexs--;
                },
                next: function() {
                    //console.log("next" + this.indexs);
                    this.indexs++;
                }
            }
        })
    </script>
</body>

</html>